print("=" * 9, "九九for循环")
for x in range(1, 10):
    for y in range(1, x + 1):
        print("{}*{}={:<2}".format(y, x, x * y), end="  ")
    print("")
print("=" * 66, "倒行")
for x in range(9, 0, -1):
    for y in range(1, x + 1):
        print("{}*{}={:<2}".format(y, x, x * y), end="  ")
    print("")
print("=" * 9, "for空格算法")
for x in range(1, 10):
    print(" " * 8 * (9 - x), end="")
    for y in range(x, 0, -1):
        print("{}*{}={:<2}".format(y, x, x * y), end="  ")
    print("")
print("=" * 66, "倒行")
for x in range(9, 0,-1):
    print(" " * 8 * (9 - x), end="")
    for y in range(x, 0, -1):
        print("{}*{}={:<2}".format(y, x, x * y), end="  ")
    print("")

print("=" * 9, "九九while循环")
x = 1
while x <= 9:
    z = 1
    while z<=x:
        print("{}*{}={:<2}".format(z, x, z * x), end="  ")
        z += 1
    x += 1
    print()
print("=" * 66, "倒行")
x = 9
while x :
    z = 1
    while z<=x:
        print("{}*{}={:<2}".format(z, x, z * x), end="  ")
        z += 1
    x -= 1
    print()
print("=" * 9, "while空格算法")
x = 1
while x<=9:
    print(" " * 8 * (9 - x), end="")
    z = x
    while z:
        print("{}*{}={:<2}".format(z, x, z * x), end="  ")
        z -= 1
    x += 1
    print()
print("=" * 66, "倒行")
x = 9
while x:
    print(" " * 8 * (9 - x), end="")
    z = x
    while z:
        print("{}*{}={:<2}".format(z, x, z * x), end="  ")
        z -= 1
    x -= 1
    print()





